how to find duplicate characters in a string in java